package com.example.dbDemo.controller;

import com.example.dbDemo.model.entity.CompanyEntity;
import com.example.dbDemo.service.CompanyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 张渠钦
 * @date 2021/7/15 15:52
 */
@RestController
@RequestMapping("/company")
@Slf4j
public class CompanyController {

    @Autowired
    private CompanyService companyService;

    @GetMapping("/list")
    public List<CompanyEntity> companies(String id) {
        return companyService.companies(id);
    }

}
